<template>
	<view class="start-container">
		<image class="col-100" src="../../static/image/bgm.jpg" mode="widthFix"/>
		<view class="time-btn cc-color-white" :style="'top:'+(sysinfo.statusBarHeight+20)+'px'">{{remainTime}}</view>
		<!-- <view class="cc-columns cc-flex-vcenter cc-flex-center" style="height: 70vh;">
			<view>
				<image src="../../static/image/logo.png" mode="widthFix" class="cc-wh-200"></image>
			</view>
			<view class="cc-size-44 cc-color-white margin-b30">途友开放平台</view>
			<view class="cc-size-24 cc-color-white">诠释芯智能</view>
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				remainTime:3,
				sysinfo:uni.getSystemInfoSync(),
				timer:null
			}
			
		},
		onLoad() {
			this.timer=setInterval(()=>{
				this.timedjs()
			},1000)
		},
		onShow() {
			
		},
		methods: {
			timedjs(){
				if(this.remainTime<= 0) {
					clearInterval(this.timer)
					const Authorization=uni.getStorageSync('Authorization')
					if(!Authorization) return uni.redirectTo({url:'/pages/login/login'})
					uni.switchTab({url: '/pages/index/index'})
				}else{
					this.remainTime--
				}
				
			}
		}
	}
</script>

<style>
.start-container{position: relative; width: 750rpx; height: 100%;}
.time-btn{position: absolute; right: 40rpx;;
	background-color: rgba(0, 0, 0, 0.4); height: 60rpx; line-height: 60rpx; border-radius: 30rpx; padding:0 30rpx;}
</style>
